<?php
namespace app\index\controller;

use app\push\model\PushMessage;
use think\Controller;

class Index extends Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->push = new PushMessage();
    }

    public function index()
    {
        return $this->fetch();
    }
    //广播消息
    public function push()
    {
        $input = input();
        $data['message'] = $input['message'];
        $data['time']    = msectime();
        $data = json_encode($data);
        $this->push->sendToAll($data);
    }
    public function joinGroup()
    {
        $input = input();
        $user_id = $input['user_id'];
//        dump($user_id);die;

    }
}
